<?php
/**
 * 淘宝物流API
 *
 * Class LogisticsAPI
 */
class ProductAPI {
    /**
     * @var null 淘宝客户端
     */
    private $_client;

    /**
     * @param $options
     *
     * @throws APIException
     */
    public function __construct($options) {
        $client=isset($options[0])?$options[0]:null;
        if(!$client||!$client instanceof TaobaoClient){
            throw new APIException(10001,'淘宝API 客户端载入失败');
        }
        $this->_client=$client;
    }

    /**
     * 获取产品信息
     *
     * @param $num_iid

     *
     * @return mixed
     */
    public function getItem($num_iid=43476423992){
        return $this->_client->api('taobao.item.get', array(
            'fields' => 'item_imgs ,prop_imgs,product_id',
            'num_iid' => $num_iid,
        ));

    }
}